<div class="box-header with-border">
    <h3 class="box-title">充值设置</h3>
    <!-- /.box-tools -->
</div>
<!-- /.box-header -->
<form role="form" onsubmit="return sub_setting_9()">
    <div class="box-body">
        <div class="form-group" style="overflow:hidden;">
            <label for="recharge_fee">充值手续费(%)</label>
            <input type="text" value="{$sys['recharge_fee']}" class="form-control" id="recharge_fee" placeholder="充值手续费">
        </div>
        <div class="form-group" style="overflow:hidden;">
            <label for="lowest_recharge">最低充值金额</label>
            <input type="text" value="{$sys['lowest_recharge']}" class="form-control" id="lowest_recharge" placeholder="最低充值金额">
        </div>
        <div class="form-group" style="overflow:hidden;">
            <label for="lowest_recharge">最高充值金额</label>
            <input type="text" value="{$sys['highest_recharge']}" class="form-control" id="highest_recharge" placeholder="最低充值金额">
        </div>
        <div class="form-group" style="overflow:hidden;">
            <label for="lowest_recharge">每日最充值上限</label>
            <input type="text" value="{$sys['day_max_recharge']}" class="form-control" id="day_max_recharge" placeholder="最低充值金额">
        </div>
    </div>
    <!-- /.box-body -->

    <div class="box-footer">
        <button type="submit" class="btn btn-primary">保存</button>
    </div>
</form>

<script>
    function sub_setting_9(){
        var recharge_fee = $("#recharge_fee").val();
        if (recharge_fee ==  "") {
            $.scojs_message("充值手续费不能为空", $.scojs_message.TYPE_ERROR);
            return false;
        }

        var lowest_recharge = $("#lowest_recharge").val();
        if (lowest_recharge ==  "") {
            $.scojs_message("最低充值金额不能为空", $.scojs_message.TYPE_ERROR);
            return false;
        }
        var highest_recharge = $("#highest_recharge").val();
        if (highest_recharge ==  "") {
            $.scojs_message("最高充值金额不能为空", $.scojs_message.TYPE_ERROR);
            return false;
        }
        var day_max_recharge = $("#day_max_recharge").val();
        if (day_max_recharge ==  "") {
            $.scojs_message("每日最充值上限不能为空", $.scojs_message.TYPE_ERROR);
            return false;
        }
        $.ajax({
            type:"POST",
            url : '__ADMIN__/'+moduleName+'/setting',
            dataType:"json",
            data:{
                id:1,
                lowest_recharge:lowest_recharge,
                highest_recharge:highest_recharge,
                day_max_recharge:day_max_recharge,
                recharge_fee:recharge_fee
            },
            beforeSend:showLoad,
            success:function(msg) {
                if (msg.code == 0)
                    $.scojs_message(msg.msg, $.scojs_message.TYPE_OK);
                else
                    $.scojs_message(msg.msg, $.scojs_message.TYPE_ERROR);
                hideLoad();
            }
        });

        return false;
    }
</script>